package com.作业.Day5;

import lombok.Data;

import java.util.Scanner;

public class Homework3 {
    public static void main(String[] args) {
        System.out.println("欢迎您来到宠物店");
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入要领养宠物的名字:");
        String strain;
        String name = scanner.next();
        System.out.print("请输入要领养的宠物类型:(1.狗狗 2.企鹅):");
        int i = scanner.nextInt();
        if (i == 1) {
            System.out.print("请输入狗狗的品种(1.聪明的拉布拉多犬 2.酷酷的雪娜瑞):");
            int variety = scanner.nextInt();
            if (variety == 1) {
                strain = "聪明的拉布拉多犬";
            } else
                strain = "酷酷的雪娜瑞";

        } else {
            System.out.print("请输入狗狗的企鹅的品种(1.帝企鹅 2.王企鹅):");
            int variety = scanner.nextInt();
            if (variety == 1)
                strain = "帝企鹅";
            else
                strain = "王企鹅";
        }
        Pet1 pet1 = new Pet1(name, strain);
        System.out.print("请输入小狗的健康值(1~100之间):");
        int heahlth = scanner.nextInt();
        System.out.println("请输入小狗的健康值(1~100之间):默认值为60");
        if (heahlth != 0)
            pet1.setHealth(heahlth);
        else
            pet1.setHealth(60);
        System.out.print("宠物的自白:");
        System.out.println(pet1.toString());

    }
}

@Data
class Pet2 {
    private String name;
    private String variety;
    private int health = 60;


    public Pet2(String name, String variety) {
        this.name = name;
        this.variety = variety;
    }

    @Override
    public String toString() {
        return "我的名字叫" + name + "，健康值是" + health + "，和主人的亲密度为0，我是一只" + variety;
    }
}